import React, { Component } from 'react';
import { string } from 'prop-types';
import { handlerPath } from '../../utils/utils';
export default class NavTitle extends Component {
  constructor(props) {
    super(props);
  }
  render() {
    const { location } = this.props;
    const titleList = handlerPath(location.pathname);
    return (
      <ul className="dfr" style={{ width: '100%', margin: '0.96rem 0' }}>
        {titleList && titleList.length > 0
          ? titleList.map((item, index) => {
              return (
                <li key={index}>
                  <span className="fnormal">{item.title}</span>
                  <span
                    className="fnormal"
                    style={{ display: index == titleList.length ? 'none' : '' }}
                  >
                    &nbsp;>&nbsp;
                  </span>
                </li>
              );
            })
          : null}
      </ul>
    );
  }
}
